// 专业
const sequelize = require('../config.js')
const { DataTypes } = require('sequelize')

const specialty = sequelize.define('specialty', {
	specialty_id:{
		type: DataTypes.INTEGER,
		primaryKey: true,
		autoIncrement: true,
	},
	specialty_name: {
	  type: DataTypes.STRING,
	  allowNull: true,
	  comment: '专业名称'
	},
	specialty_Date: {
	  type: DataTypes.STRING,
	  allowNull: true,
	  comment: '专业学制'
	},
	specialty_score:{
		type:DataTypes.STRING,
		comment:"专业学分"
	},
	specialty_school_id:{
		type:DataTypes.INTEGER,
		comment:'所属院校ID',
		references: {
			model: 'school_infos',
			key: 'school_id'
		},
		onUpdate: 'CASCADE',	
	},
  },{ timestamps: false});
//   (async () => {
// 	await reservation.sync({alter:true});
//   })()

module.exports = specialty